package cn.edu.swu.cly;

public class Main {

    public static void main(String[] args) {

        //带参数构造
        Student s1 = new Student("20250917001","张国","男",18);
        Student s2 = new Student("20250917002","李强","男",19);
        Student s3 = new Student("20250919101","王爽","女",18);
        Student s4 = new Student("20250919102","赵苗","k",20);

        //输出学生信息
        Student student[] = {s1,s2,s3,s4};

        System.out.println("----- 学生信息 -----");
        for(int i = 0; i < student.length; i++) {
            student[i].showInfo();
            System.out.println("------------------");
        }

        Course c1 = new Course("202509171001","C语言高级程序设计","王晓曼讲师");
        Course c2 = new Course("202509192001","JavaWeb应用开发","刘燕姿教授");
        Course c3 = new Course("202509192002","数据结构与算法","冯教授");

        //输出课程信息
        Course course[] = {c1,c2,c3};
        System.out.println("\n----- 课程信息 -----");
        for (int i = 0; i < course.length; i++) {
            course[i].showInfo();
            System.out.println("------------------");
        }

        //setter修改学生年龄和授课老师信息
        System.out.println("\n\n========== 信息已修改 ===========\n");
        student[0].setAge(22);
        course[0].setTeacher("王传君老师(已更正)");
        student[3].setGender("女");

        System.out.println("----- 修改后学生信息 -----");
        for(int i = 0; i < student.length; i++) {
            student[i].showInfo();
            System.out.println("------------------");
        }

        System.out.println("\n----- 修改后课程信息 -----");
        for (int i = 0; i < course.length; i++) {
            course[i].showInfo();
            System.out.println("------------------");
        }

        //使用getter获取优秀学生信息
        String GoodStudent = s1.getId();
        String GoodStuName = s1.getName();

        System.out.println("恭喜: " + GoodStudent + " " + GoodStuName + " 荣获优秀学生");
    }
}
